#! /bin/bash

# 从mysql导入数据到oe_ods层的在读班级的每天在读学员总人数表中
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query 'select * from class_studying_student_count where 1=1 and $CONDITIONS' \
--hcatalog-database oe_ods \
--hcatalog-table teach_class_studying_student_count \
-m 1

# 从mysql导入数据到oe_ods层的班级排课信息表中
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query 'select * from course_table_upload_detail where 1=1 and $CONDITIONS' \
--hcatalog-database oe_ods \
--hcatalog-table teach_course_table_upload_detail \
-m 1

# 从mysql导入数据到oe_ods层的学生打卡记录表中
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query 'select * from student_leave_apply where 1=1 and $CONDITIONS' \
--hcatalog-database oe_ods \
--hcatalog-table teach_student_leave_apply \
-m 1

# 从mysql导入数据到oe_ods层的班级作息时间表中
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query 'select * from tbh_class_time_table where 1=1 and $CONDITIONS' \
--hcatalog-database oe_ods \
--hcatalog-table teach_tbh_class_time_table \
-m 1

# 从mysql导入数据到oe_ods层的学生请假申请表中
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query 'select * from tbh_student_signin_record where 1=1 and $CONDITIONS' \
--hcatalog-database oe_ods \
--hcatalog-table teach_tbh_student_signin_record \
-m 1